{php $shang=\Phpcmf\Service::M()->db->table('1_quan_shezhi')->where('dirname', 'dashang')->get()->getRowArray();}

{php $v = dr_string2array($shang['setting']);}

{php $dashangdata = $v['pages'];}

<!--打赏权限-->
{php $dashangquanxian = $dashangdata['quan_dashang_quanxian'];}
<!--金额-->
{php $dashangyi = $dashangdata['quan_dashang_rmb_yi'];}
{php $dashanger = $dashangdata['quan_dashang_rmb_er'];}
{php $dashangsan = $dashangdata['quan_dashang_rmb_san'];}
{php $dashangsi = $dashangdata['quan_dashang_rmb_si'];}
{php $dashangwu = $dashangdata['quan_dashang_rmb_wu'];}
{php $dashangliu = $dashangdata['quan_dashang_rmb_liu'];}
<!--积分-->
{php $dashangjifenyi = $dashangdata['quan_dashang_jifen_yi'];}
{php $dashangjifener = $dashangdata['quan_dashang_jifen_er'];}
{php $dashangjifensan = $dashangdata['quan_dashang_jifen_san'];}
{php $dashangjifensi = $dashangdata['quan_dashang_jifen_si'];}
{php $dashangjifenwu = $dashangdata['quan_dashang_jifen_wu'];}
{php $dashangjifenliu = $dashangdata['quan_dashang_jifen_liu'];}
<!--开启帖子打赏-->
{php $dashangcomment = $shang['comment'];}
{if $dashangcomment ==1}
    {php $tiedashangkai = $dskg;}
{else}
    
	{php $tiedashangkai = 1;}
{/if}

{if $dashangquanxian ==0}
<!--全站统一开启-->
    <!--开关-->
    {php $dashangkaiguan = $dashangdata['quan_dashang_kaiguan'];}

{elseif $dashangquanxian ==1}
<!--根据圈子管理-->
	<!--开关-->
	{if $index['dashangkai'] == 1}
		{php $dashangkaiguan=0;}
	{else}
		{php $dashangkaiguan=1;}
	{/if}
{elseif $dashangquanxian ==2}
<!--根据作者管理-->
    {php $dashanguidkai = \Phpcmf\Service::M()->db->table('member_data')->where('id', $uid)->get()->getRowArray();}
    {if $dashanguidkai['dashangkaiguan'] ==1}
		{php $dashangkaiguan=0;}
	{else}
		{php $dashangkaiguan=1;}
	{/if}
{/if}
<!--打赏模式-->
{php $dashangmoshi = $dashangdata['quan_dashang_moshi'];}
<!--$dashangkaiguan==0开，1关闭-->
<!--$fufeils==1人民币，2积分，-->

{php $jifen = $shangjifens['jifen'];}
{php $jiage = $shangjifens['jiage'];}

{php $v = dr_string2array($shang['value']);}
{count action=table table=1_quan_dashang_buy tid=$id return=dashangtongji}

{if $dashangkaiguan == 0}
    {if $tiedashangkai == 0}
		<nav aria-label="">
			<ul class="pager">
				<li class="d-zitiyanse-bai">
					<a onclick="javascript:d_dashang();" class="d-zitiyanse-ba d-wenzi-16" style="background-color: #3ebdaa;">
						<i class="bi bi-server"></i> 打赏
					</a>
					
					{if $dashangtongji_count >0}
					<br>
						{if $member.id==$uid || $member.is_admin}
						<a href="{dr_member_url('quan/dashang/index',['tid'=>$id,'quanid'=>$index.id])}">
						<span class="d-wenzi-12" style="color:#797979;">
							已有<span class="d-wenzi-16 d-jiacu" style="color:#38b5a7;"> {$dashangtongji_count} </span>位打赏
						</span>
						</a>
						{else}
						<span class="d-wenzi-12" style="color:#797979;">
							已有<span class="d-wenzi-16 d-jiacu" style="color:#38b5a7;"> {$dashangtongji_count} </span>位打赏
						</span>
						{/if}
					{/if}
				</li>
			</ul>
		</nav>
		{if $dashangtongji_count >0}
		<div class="">
			<div class="row ">

				<nav aria-label="">
					
					<ul class="pager" style="margin: 1px 1px 20px 1px;">
					  {table table=1_quan_dashang_buy tid=$id page=1 pagesize=10 return=tt}
					  <li>
						  <img src="{dr_avatar($tt.uid)}" width="25" height="25" class="d-touxiang-10" id="gerenzan_{$t.id}_{$tt.uid}" data-id="{$tt.uid}"/>
					  </li>
					  {/table}
					</ul>
			</div>
		</div>
		{/if}
		<div class="d-dashang d-xiala-dashang" style="display: none;">
			<div class="d-container">
				<div class="d-row">
					<div class="d-col-md-8-juzhong d-quxian-0 d-a-baise">
						<div class="col-xs-12 ">
						<div class="col-xs-12 d-wenzi-juzhong d-quxian-0 d-shang-10">
							<div class="d-kuan d-neikuang-10" onclick="javascript:d_dashang();"><i class="bi bi-x-circle-fill d-wenzi-18"></i></div>
						</div>
						{if $dashangmoshi == '0'}
						<form action="{SITE_MURL}index.php" method="get" class="form-horizontal0" >
							<input type="hidden" name="s" value="quan" />
							<input type="hidden" name="c" value="dashang" />
							<input type="hidden" name="m" value="index" />
							<input type="hidden" name="id" value="{$id}" />
							<div>
								<div class="col-xs-12">
									<div onclick="javascript:dashang(1,1);" id="da1" data-id="1" class="d-dashang-xuanze das1 col-md-4 col-xs-4 mr-2 d-xia-10 btn-default dashangan">
									<input type="radio" name="money2" id="catid1" value="{$dashangyi}" checked>{$dashangyi} 元</div>
									<div onclick="javascript:dashang(2,2);" id="da2" data-id="2" class="d-dashang-xuanze das2 col-md-4 col-xs-4 mr-2 d-xia-10 btn btn-default">
									<input type="radio" name="money2" id="catid2" value="{$dashanger}">{$dashanger} 元</div>
									<div onclick="javascript:dashang(3,3);" id="da3" data-id="3" class="d-dashang-xuanze das3 col-md-4 col-xs-4 mr-2 d-xia-10 btn btn-default">
									<input type="radio" name="money2" id="catid3" value="{$dashangsan}">{$dashangsan} 元</div>
									<div onclick="javascript:dashang(4,4);" id="da4" data-id="4" class="d-dashang-xuanze das4 col-md-4 col-xs-4 mr-2 d-xia-10  btn btn-default">
									<input type="radio" name="money2" id="catid4" value="{$dashangsi}">{$dashangsi} 元</div>
									<div onclick="javascript:dashang(5,5);" id="da5" data-id="5" class="d-dashang-xuanze das5 col-md-4 col-xs-4 mr-2  d-xia-10 btn btn-default">
									<input type="radio" name="money2" id="catid5" value="{$dashangwu}">{$dashangwu} 元</div>
									<div onclick="javascript:dashang(6,6);" id="da6" data-id="6" class="d-dashang-xuanze col-md-4 col-xs-4 mr-2 d-xia-10 ">
										<input type="text" name="money" id="catid6" value="" class="form-controldashang wenzijuzhong" placeholder="自定义" style="color: black;">
									</div>
								</div>
								<div class="col-xs-12">
									<button type="submit" class="btn btn-ms d-kuan"> 确认打赏 </button>
								</div>
							</div>
						</form>
						{elseif $dashangmoshi == '1'}
						<form action="{SITE_MURL}index.php" method="get" class="form-horizontal0">
							<input type="hidden" name="s" value="quan" />
							<input type="hidden" name="c" value="dashang" />
							<input type="hidden" name="m" value="jifen" />
							<input type="hidden" name="id" value="{$id}" />
							
							<div>
								<div class="col-xs-12">
									<div onclick="javascript:dashang(1,1);" id="da1" data-id="1" class="d-dashang-xuanze das1 col-md-4 col-xs-4 mr-2 d-xia-10 btn-default dashangan">
									<input type="radio" name="money2" id="catid1" value="{$dashangjifenyi}" checked>{$dashangjifenyi} {SITE_SCORE}</div>
									<div onclick="javascript:dashang(2,2);" id="da2" data-id="2" class="d-dashang-xuanze das2 col-md-4 col-xs-4 mr-2 d-xia-10 btn btn-default">
									<input type="radio" name="money2" id="catid2" value="{$dashangjifener}">{$dashangjifener} {SITE_SCORE}</div>
									<div onclick="javascript:dashang(3,3);" id="da3" data-id="3" class="d-dashang-xuanze das3 col-md-4 col-xs-4 mr-2 d-xia-10 btn btn-default">
									<input type="radio" name="money2" id="catid3" value="{$dashangjifensan}">{$dashangjifensan} {SITE_SCORE}</div>
									<div onclick="javascript:dashang(4,4);" id="da4" data-id="4" class="d-dashang-xuanze das4 col-md-4 col-xs-4 mr-2 d-xia-10  btn btn-default">
									<input type="radio" name="money2" id="catid4" value="{$dashangjifensi}">{$dashangjifensi} {SITE_SCORE}</div>
									<div onclick="javascript:dashang(5,5);" id="da5" data-id="5" class="d-dashang-xuanze das5 col-md-4 col-xs-4 mr-2  d-xia-10 btn btn-default">
									<input type="radio" name="money2" id="catid5" value="{$dashangjifenwu}">{$dashangjifenwu} {SITE_SCORE}</div>
									<div onclick="javascript:dashang(6,6);" id="da6" data-id="6" class="d-dashang-xuanze col-md-4 col-xs-4 mr-2 d-xia-10 ">
										<input type="text" name="money" id="catid6" value="" class="form-controldashang wenzijuzhong" placeholder="自定义" style="color: black;">
									</div>
								</div>
								<div class="col-xs-12">
									<button type="submit" class="btn btn-ms d-kuan"> 确认打赏 </button>
								</div>
							</div>
						</form>
						{elseif $dashangmoshi == '2'}
						{/if}
						</div>
					</div>
				</div>
			</div>
			
		</div>
	{/if}
{/if}

<div id="ajax_poster"></div>
<style>
	.d-xiala-dashang {
	    z-index: 999999;
	    position: fixed;
	    bottom: 0px;
	    width: 100%;
	    height: 40%;
	    overflow: auto;
	    background: #ffffff;
	    right: 0;
	    left: 0;
	    box-shadow: 0 0 20px #d6d6d6;
	    background-color: rgba(255, 255, 255, 1.0);
	}
	.mt-checkbox>span, .mt-radio>span {
	    border: 1px solid transparent;
	    position: absolute;
	    top: 5px;
	    left: 5px;
	    height: 19px;
	    width: 19px;
	    background: #E6E6E6;
	}
	.dashangan {
	    text-align: center;
	    background: #ffffff;
	    background-color: #11d2b5;
	    padding: 6px 12px 0 12px;
	    height: 50px;
	    color: #ffffff;
	    line-height: 2.4;
	    font-size: 16px;
	    border-radius: 4px;
	}
	.btn-default.active, .btn-default:active, .btn-default:hover, .open>.btn-default.dropdown-toggle {
	    color: #ffffff;
	    background-color: #11d2b5;
	    border-color: #ffffff;
	}
	
	div.btn {
	    background: #f6f6f6;
	    padding: 6px 12px 0 12px;
	    height: 50px;
		border-color: #fff;
	}
	.btn:not(.btn-sm):not(.btn-lg) {
	    line-height: 2.5;
	}
	input {
	    -webkit-appearance: none;
	    -moz-appearance: none;
	    -o-appearance: none;
	    appearance: none;
	}
	.form-controldashang {
	    width: 100%;
	    height: 50px;
	    padding: 6px 12px;
	    background-color: #fff;
	    border: 1px solid #E4E6EF;
	    color: #3F4254;
	    background-clip: padding-box;
	    border-radius: 5px;
	    -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
	    -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
	    -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
	    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
	}
	.form-controldashang:focus{
		
		border-color: blue;
	}
	.wenzijuzhong {
	    text-align: center;
	}
</style>
<script type="text/javascript">

	function d_dashang() {
		if ($('.d-dashang').is(':hidden')) {
			$('.d-dashang').show();
		} else {
			$('.d-dashang').hide();
		}
	}
	function dashang(e,id) {
			//var id = $(this).data("id");
		
			var input = document.getElementById('catid'+e);
			input.checked=true;
			input.removeAttribute('checked');
			// 移除所有div的高亮类  

				$('.d-dashang-xuanze').removeClass('dashangan');
				$("#da"+e).addClass('dashangan');
			
				$('.d-dashang-xuanze').addClass('btn');
				
				$("#da"+e).removeClass('btn');
				$("#da6").removeClass('btn');
				$("#da6").removeClass('dashangan');
				if(e==6){
					// 移除id为catid1到catid5的radio按钮的checked属性  
					$('#catid1, #catid2, #catid3, #catid4, #catid5').prop('checked', false);  
				}
				 

	}
	
</script>

